package com.yemast.readertesst

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.jsoup.Jsoup
import org.jsoup.nodes.Element

class VideoActivity : AppCompatActivity() {


    var pagesize = 30

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_video)

        GlobalScope.launch {
            //offset  每次增加30
            val connect = Jsoup.connect("https://v.qq.com/x/bu/pagesheet/list?append=1&channel=tv&listpage=2&offset=0&pagesize=$pagesize").get()
            val url =
                (connect.childNodes()[0].childNodes()[1].childNodes()[0] as Element).getElementsByTag(
                    "a"
                )[0].attributes().get("href")

            val pageurl = Jsoup.connect(url).get()


//            pageurl.getElementsByClass("mod_episode")[0].getElementsByTag("a")[0].attr("abs:href")//获取集数
            Log.e("tag", "");

        }
    }
}
